add some no-indicator radio buttons
authorjacob berkman <jacob@ximian.com>
Fri, 16 Nov 2001 22:56:21 +0000 (22:56 +0000)
committerJacob Berkman <jberkman@src.gnome.org>
Fri, 16 Nov 2001 22:56:21 +0000 (22:56 +0000)
2001-11-16  jacob berkman  <jacob@ximian.com>

* tests/testgtk.c (create_radio_buttons): add some no-indicator
radio buttons

* gtk/gtkradiobutton.c (gtk_radio_button_init): since we are
initially active, also initially be depressed
(gtk_radio_button_clicked): also update our depressed state

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkradiobutton.c
tests/testgtk.c

index 24e92b497d8f9b559b3c38f52b82ad40a562a0e8..2fab1366f3e0bf389658511d8e9e03f00b52432f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2001-11-16  jacob berkman  <jacob@ximian.com>
+
+       * tests/testgtk.c (create_radio_buttons): add some no-indicator
+       radio buttons
+
+       * gtk/gtkradiobutton.c (gtk_radio_button_init): since we are
+       initially active, also initially be depressed
+       (gtk_radio_button_clicked): also update our depressed state
+
 Thu Nov 15 12:54:36 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwindow.c (gtk_window_key_press_event): Propagate
index 24e92b497d8f9b559b3c38f52b82ad40a562a0e8..2fab1366f3e0bf389658511d8e9e03f00b52432f 100644 (file)
@@ -1,3 +1,12 @@
+2001-11-16  jacob berkman  <jacob@ximian.com>
+
+       * tests/testgtk.c (create_radio_buttons): add some no-indicator
+       radio buttons
+
+       * gtk/gtkradiobutton.c (gtk_radio_button_init): since we are
+       initially active, also initially be depressed
+       (gtk_radio_button_clicked): also update our depressed state
+
 Thu Nov 15 12:54:36 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwindow.c (gtk_window_key_press_event): Propagate
index 24e92b497d8f9b559b3c38f52b82ad40a562a0e8..2fab1366f3e0bf389658511d8e9e03f00b52432f 100644 (file)
@@ -1,3 +1,12 @@
+2001-11-16  jacob berkman  <jacob@ximian.com>
+
+       * tests/testgtk.c (create_radio_buttons): add some no-indicator
+       radio buttons
+
+       * gtk/gtkradiobutton.c (gtk_radio_button_init): since we are
+       initially active, also initially be depressed
+       (gtk_radio_button_clicked): also update our depressed state
+
 Thu Nov 15 12:54:36 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwindow.c (gtk_window_key_press_event): Propagate
index 24e92b497d8f9b559b3c38f52b82ad40a562a0e8..2fab1366f3e0bf389658511d8e9e03f00b52432f 100644 (file)
@@ -1,3 +1,12 @@
+2001-11-16  jacob berkman  <jacob@ximian.com>
+
+       * tests/testgtk.c (create_radio_buttons): add some no-indicator
+       radio buttons
+
+       * gtk/gtkradiobutton.c (gtk_radio_button_init): since we are
+       initially active, also initially be depressed
+       (gtk_radio_button_clicked): also update our depressed state
+
 Thu Nov 15 12:54:36 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwindow.c (gtk_window_key_press_event): Propagate
index 24e92b497d8f9b559b3c38f52b82ad40a562a0e8..2fab1366f3e0bf389658511d8e9e03f00b52432f 100644 (file)
@@ -1,3 +1,12 @@
+2001-11-16  jacob berkman  <jacob@ximian.com>
+
+       * tests/testgtk.c (create_radio_buttons): add some no-indicator
+       radio buttons
+
+       * gtk/gtkradiobutton.c (gtk_radio_button_init): since we are
+       initially active, also initially be depressed
+       (gtk_radio_button_clicked): also update our depressed state
+
 Thu Nov 15 12:54:36 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwindow.c (gtk_window_key_press_event): Propagate
index 24e92b497d8f9b559b3c38f52b82ad40a562a0e8..2fab1366f3e0bf389658511d8e9e03f00b52432f 100644 (file)
@@ -1,3 +1,12 @@
+2001-11-16  jacob berkman  <jacob@ximian.com>
+
+       * tests/testgtk.c (create_radio_buttons): add some no-indicator
+       radio buttons
+
+       * gtk/gtkradiobutton.c (gtk_radio_button_init): since we are
+       initially active, also initially be depressed
+       (gtk_radio_button_clicked): also update our depressed state
+
 Thu Nov 15 12:54:36 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwindow.c (gtk_window_key_press_event): Propagate
index 24e92b497d8f9b559b3c38f52b82ad40a562a0e8..2fab1366f3e0bf389658511d8e9e03f00b52432f 100644 (file)
@@ -1,3 +1,12 @@
+2001-11-16  jacob berkman  <jacob@ximian.com>
+
+       * tests/testgtk.c (create_radio_buttons): add some no-indicator
+       radio buttons
+
+       * gtk/gtkradiobutton.c (gtk_radio_button_init): since we are
+       initially active, also initially be depressed
+       (gtk_radio_button_clicked): also update our depressed state
+
 Thu Nov 15 12:54:36 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwindow.c (gtk_window_key_press_event): Propagate
index 7c7148aae097690b3f75a4ea4ecb699b2fa7ba4b..9e6e169661fccdb06fc371e4ef71f39023ff81f6 100644 (file)
@@ -116,6 +116,7 @@ gtk_radio_button_init (GtkRadioButton *radio_button)
 
   radio_button->group = g_slist_prepend (NULL, radio_button);
 
+  _gtk_button_set_depressed (GTK_BUTTON (radio_button), TRUE);
   gtk_widget_set_state (GTK_WIDGET (radio_button), GTK_STATE_ACTIVE);
 }
 
@@ -495,6 +496,7 @@ gtk_radio_button_clicked (GtkButton *button)
   GtkStateType new_state;
   GSList *tmp_list;
   gint toggled;
+  gboolean depressed;
 
   g_return_if_fail (GTK_IS_RADIO_BUTTON (button));
 
@@ -552,12 +554,21 @@ gtk_radio_button_clicked (GtkButton *button)
       new_state = (button->in_button ? GTK_STATE_PRELIGHT : GTK_STATE_ACTIVE);
     }
 
+  if (toggle_button->inconsistent)
+    depressed = FALSE;
+  else if (button->in_button && button->button_down)
+    depressed = !toggle_button->active;
+  else
+    depressed = toggle_button->active;
+
   if (GTK_WIDGET_STATE (button) != new_state)
     gtk_widget_set_state (GTK_WIDGET (button), new_state);
 
   if (toggled)
     gtk_toggle_button_toggled (toggle_button);
 
+  _gtk_button_set_depressed (button, depressed);
+
   gtk_widget_queue_draw (GTK_WIDGET (button));
 
   gtk_widget_unref (GTK_WIDGET (button));
index ca99e5fa57818ed4c8902bff895ffeffbfffe307..3969e04d281673c831d8b06829b4e29f278361aa 100644 (file)
@@ -680,6 +680,26 @@ create_radio_buttons (void)
       separator = gtk_hseparator_new ();
       gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0);
 
+      button = gtk_radio_button_new_with_label (NULL, "button4");
+      gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (button), FALSE);
+      gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
+
+      button = gtk_radio_button_new_with_label (
+                gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)),
+                "button5");
+      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
+      gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (button), FALSE);
+      gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
+
+      button = gtk_radio_button_new_with_label (
+                 gtk_radio_button_get_group (GTK_RADIO_BUTTON (button)),
+                "button6");
+      gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (button), FALSE);
+      gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0);
+
+      separator = gtk_hseparator_new ();
+      gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0);
+
       box2 = gtk_vbox_new (FALSE, 10);
       gtk_container_set_border_width (GTK_CONTAINER (box2), 10);
       gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE, 0);